#!/usr/bin/perl

use utf8;
use strict;
use warnings;
use autodie;
use 5.010001;

my $number = int(1 + rand 100);

while (<>) {

	chomp;
	
	given( $_ ) {
		when ( 'quit' || 'exit' ) { say 'Goodbye'; last; }
		when ( ! /\A\d+\Z/ ) {say "Not a number!"; break }
		when ( $_ > $number ) { say 'Too large.'; break }
		when ( $_ < $number ) { say 'Too small.'; break }
		when ( $number ) { say 'Great!'; last; }
		when ( 1 eq 1 ) { say 'Input ERROR'; }
	}
}